package com.csd.action.team;

import java.util.List;

import com.csd.helper.ActionResult;
import com.csd.pojo.CostRecord;
import com.csd.pojo.Project;
import com.csd.serviceImpl.CostRecordService;
import com.csd.serviceImpl.ProjectService;

/**
 * 
 * Action：查询所有花费记录
 * @author csd
 * @version 1.0
 * 
 * <br> 修订时间：2009-12-17
 * <br> 修改原因：创建文件
 * <br> 修改人：刘世彬
 * 
 * <br> 
 * 
 */
public class CostListAction {
	/**项目ID*/
	private String projectID;

	private List<CostRecord> list ;
	
	private CostRecordService service;
	
	private String projectState;
	
	public String getProjectState() {
		return projectState;
	}

	public void setProjectState(String projectState) {
		this.projectState = projectState;
	}

	public CostRecordService getService() {
		return service;
	}

private ProjectService projectService;
	
	
	public ProjectService getProjectService() {
		return projectService;
	}

	public void setProjectService(ProjectService projectService) {
		this.projectService = projectService;
	}
	public void setService(CostRecordService service) {
		this.service = service;
	}

	public List<CostRecord> getList() {
		return list;
	}

	public void setList(List<CostRecord> list) {
		this.list = list;
	}

	public String getProjectID() {
		return projectID;
	}

	public void setProjectID(String projectID) {
		projectID = projectID;
	}
	
	public String execute(){
		String result = ActionResult.fail;
		
		List list = projectService.listTeamProject();
		if(list!=null && list.size()>0)
		{
			Project project = (Project)list.get(0);
			this.projectState = project.getState();
			this.list = service.listCostRecordByTeam();
		}
		
		result = ActionResult.success;
		
		return result;
	}
}
